package cn.oowoo.sentinelclusterserver;

import cn.oowoo.sentinelclusterserver.config.DemoClusterServerInitFunc;
import com.alibaba.csp.sentinel.cluster.server.ClusterTokenServer;
import com.alibaba.csp.sentinel.cluster.server.SentinelDefaultTokenServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SentinelClusterTokenServerApplication {

    public static void main(String[] args) throws Exception {
        initClusterTokenServer();
        SpringApplication.run(SentinelClusterTokenServerApplication.class, args);
    }

    private static void initClusterTokenServer() throws Exception {
        ClusterTokenServer tokenServer = new SentinelDefaultTokenServer();
        tokenServer.start();
        new DemoClusterServerInitFunc().init();
    }

}
